home *** CD-ROM | disk | FTP | other *** search
- public class DoubleDoorPivotSwitchPivot extends Codex {
- private float _duration = 3.0F;
- private CodexThing _switch = new CodexThing(((Codex)this).GetClassThing());
- private CodexThing _door1;
- private CodexThing _door2;
- private int _frameNum = 1;
- private boolean bOpen;
- private boolean bActive;
- public static String[] _params = new String[]{"Duration;3.0", "First half door", "Second half door"};
-
- public void clicked(int guid, int clickerGuid, int captureId) {
- if (guid != this._switch.GetGUID()) {
- new CodexSound("locked_large_02.WAV", 300.0F, 600.0F, 100, 0, 0, clickerGuid);
- CodexConsole.PrintNLS(clickerGuid, 0, "GEN_OPENELSEWHERE");
- } else {
- this.bActive = true;
- if (!this.bOpen) {
- this._switch.RotatePivot(this._frameNum, this._duration);
- this._door1.RotatePivot(this._frameNum, this._duration);
- this._door2.RotatePivot(this._frameNum, this._duration);
- this.bOpen = true;
- } else {
- this._switch.RotatePivot(this._frameNum, -this._duration);
- this._door1.RotatePivot(this._frameNum, -this._duration);
- this._door2.RotatePivot(this._frameNum, -this._duration);
- this.bOpen = false;
- }
-
- }
- }
-
- public void beginscene(int clientGuid, int captureID) {
- this._door1.SetThingFlags(8192);
- this._door2.SetThingFlags(8192);
- }
-
- public void arrived(int thingGuid, int frameNum, int captureId) {
- this.bActive = false;
- }
-
- public void restore(int flags) {
- this.bOpen = CodexSequence.RestoreBoolean();
- }
-
- public void save(int flags) {
- CodexSequence.SaveBoolean(this.bOpen);
- }
-
- public DoubleDoorPivotSwitchPivot(float duration, CodexThing door1, CodexThing door2) {
- this._duration = duration;
- this._door1 = new CodexThing(((Codex)door1).GetGUID());
- this._door2 = new CodexThing(((Codex)door2).GetGUID());
- ((Codex)this).CaptureThing(this._door1.GetGUID());
- ((Codex)this).CaptureThing(this._door2.GetGUID());
- if (this._door1.GetDescriptionID().equalsIgnoreCase("PROP")) {
- this._door1.SetDescriptionID("GEN_DOOR");
- }
-
- if (this._door2.GetDescriptionID().equalsIgnoreCase("PROP")) {
- this._door2.SetDescriptionID("GEN_DOOR");
- }
-
- if (this._switch.GetDescriptionID().equalsIgnoreCase("PROP")) {
- this._switch.SetDescriptionID("GEN_SWITCH");
- }
-
- }
- }
-